package club.terroir.server.util;

import java.util.UUID;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class UtilPersistence {
	private static final EntityManagerFactory emfInstance = Persistence
			.createEntityManagerFactory("transactions-optional");

	public static EntityManagerFactory get() {
		return emfInstance;
	}
	
	public static  long generateID() {
	   UUID uuid =  UUID.randomUUID();
	   return uuid.getLeastSignificantBits();
	}
	
	public static void main(String[] s){
		for( int i =0; i<20;i++){
			System.out.println(""+generateID());
		}
	}

}
